using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ArchSoft
{
    public partial class FrmAbout : Form
    {
        const int CS_DROPSHADOW = 0x00020000;       

        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.ClassStyle |= CS_DROPSHADOW;
                return cp;
            }
        }
        
        public FrmAbout()
        {
            InitializeComponent();
            Cursor.Position = new Point(Screen.PrimaryScreen.Bounds.Width / 2, Screen.PrimaryScreen.Bounds.Height / 2);
        }

        private void FrmAbout_Load(object sender, EventArgs e)
        {
            this.Lbl_UserName.Text = Environment.UserName;
            //this.Lbl_ComputerName.Text = Environment. Application.CompanyName.Replace("Company","") + " Co.,Ltd";
          
            this.Lbl_UserName.Left = 324 - this.Lbl_UserName.Width;
            this.Lbl_ComputerName.Left = 324 - this.Lbl_ComputerName.Width;
        }

        private void FrmAbout_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void panel1_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void Lbl_UserName_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void Lbl_ComputerName_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void label1_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {            
            if (this.Opacity != 1.0)
            {
                this.Opacity += 0.2;
                if (this.Opacity == 1.0)
                {                    
                    timer1.Stop();                    
                }
            }
        }

        private void FrmAbout_MouseLeave(object sender, EventArgs e)
        {
            //if (Cursor.Position.X < this.Location.X || Cursor.Position.X > this.Location.X + Width || Cursor.Position.Y < this.Location.Y || Cursor.Position.Y > this.Location.Y + Height)
            //    Close();
        }
    }
}